<extend name="layout/index"/>
<block name="content">
    <link rel="stylesheet" href="/static/admin/css/font-awesome.css" />
    <link rel="stylesheet" href="/static/admin/css/style.css" />
    <link rel="stylesheet" href="/static/admin/css/plugins/summernote/summernote.css" />
    <link rel="stylesheet" href="/static/admin/css/plugins/summernote/summernote-bs3.css" />
    <div class="wrapper wrapper-content">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>关于我们</h5>
                    </div>
                    <div class="ibox-content">
                        <form role="form" class="form-horizontal m-t" method="post">
                            <div class="form-group draggable">
                                <label class="col-sm-3 control-label">C端用户增加：</label>
                                <div class="col-sm-9">
                                    <input type="number" name="ccount" class="form-control" placeholder="请输入文本" value="{$info.ccount}">
                                </div>
                            </div>
                            <div class="form-group draggable">
                                <label class="col-sm-3 control-label">B端用户增加：</label>
                                <div class="col-sm-9">
                                    <input type="number" name="bcount" class="form-control" placeholder="请输入文本" value="{$info.bcount}">
                                </div>
                            </div>
                            <div class="form-group draggable">
                                <label class="col-sm-3 control-label">涉及行业：</label>
                                <div class="col-sm-9">
                                    <input type="number" name="dcount" class="form-control" placeholder="请输入文本" value="{$info.dcount}">
                                </div>
                            </div>
                            <div class="form-group draggable">
                                <label class="col-sm-3 control-label">标题：</label>
                                <div class="col-sm-9">
                                    <input type="text" name="title" class="form-control" placeholder="请输入文本" value="{$info.title}">
                                </div>
                            </div>
                            <div class="form-group draggable">
                                <label class="col-sm-3 control-label">视频链接：</label>
                                <div class="col-sm-9">
                                    <input type="text" name="video" class="form-control" placeholder="请输入链接" value="{$info.video}">
                                </div>
                            </div>
                            <div class="form-group draggable">
                                <label class="col-sm-3 control-label">内容：</label>
                                <div class="col-sm-9">
                                    <textarea  name="des" rows="4" class="form-control" placeholder="内容">{$info.des}</textarea>
                                    <span class="help-block m-b-none">在列表展示的内容</span>
                                </div>
                            </div>
                            <div class="form-group draggable">
                                <label class="col-sm-3 control-label">上传图片：</label>
                                <div class="input-file-show col-sm-2">
                                    <input type="hidden" id="image" name="image" value="{$info.image}" class="type-file-text form-control">
                                    <input type="button" name="button" value="选择上传..." onclick="GetUploadify('img_call_back')" class="type-file-button form-control layui-btn">
                                    <div class="putrue">
                                        <img id="userimg_i" class="fa fa-picture-o" src="{$info.image}" alt=""/>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group draggable">
                                <label class="col-sm-3 control-label">安卓APP下载链接：</label>
                                <div class="col-sm-9">
                                    <input type="text" name="url" class="form-control" placeholder="请输入链接" value="{$info.url}">
                                </div>
                            </div>
                            <div class="form-group draggable">
                                <label class="col-sm-3 control-label">苹果APP下载链接：</label>
                                <div class="col-sm-9">
                                    <input type="text" name="iosurl" class="form-control" placeholder="请输入链接" value="{$info.iosurl}">
                                </div>
                            </div>
                            <div class="form-group draggable">
                                <label class="col-sm-3 control-label">详细介绍：</label>
                                <div class="col-sm-9">
                                    <div class="summernote">{$info.content|raw}</div>
                                    <input type="hidden" id="contents" name="content" value="{$info.content}">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group draggable">
                                <div class="col-sm-12 col-sm-offset-3">
                                    <button class="btn btn-primary" type="button">保存内容</button>
                                    <button class="btn btn-white" type="reset">取消</button>
                                </div>
                            </div>
                        </form>
                        <div class="clearfix"></div>
                    </div>
                </div>
            </div>

        </div>
    </div>
</block>
<block name="js">
    <script src="/static/admin/js/plugins/summernote/summernote.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="/static/admin/js/plugins/summernote/summernote-zh-CN.js" type="text/javascript" charset="utf-8"></script>
    <script src="/static/admin/js/plugins/layui/layui.js" type="text/javascript" charset="utf-8"></script>
    <script>
            //HTML编辑器
            $('.summernote').summernote({
                lang : 'zh-CN',
                onblur : function(e) {
                    var sHTML = $('.summernote').code();
                    $("#contents").val(sHTML);
                },
                height:"300px",
                width:"1000px",
                focus: true,
            });
        //上传文件后，更改路径
        function img_call_back(fileurl_tmp) {
            $("#image").val(fileurl_tmp);
            $("#userimg_i").attr('src',fileurl_tmp); //layer.open('<img src="+fileurl_tmp+">',this,{tips: [1, '#fff']});
        }
        $(".btn-primary").click(function(){
         //   alert($("form").serialize());
            $.ajax({
                type : "post",
                url : "{:url('index/about')}",
                data : $("form").serialize(),
                dataType : "json",
                success : function(data) {
                    layer.msg(data.msg);
                    if (data.code==1) {
                        location.href=data.url;;
                    }
                },
                error : function(err) {
                    layer.alert(err.info, 8);
                }
            });
        })
    </script>
</block>

